home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / fortran / fatdos.zip / FATD1.DOC < prev    next >
Text File  |  1988-04-15  |  24KB  |  951 lines

  1.  
  2.     FAT-DOS 1.0            ALLMEM            PAGE A-1
  3.  
  4.  
  5.  
  6.     ALLMEM - Allocates memory dynamically at run-time.
  7.  
  8.     integer*2   Npar,Seg,Maxpar
  9.         call AllMem(Npar,Seg,Maxpar)
  10.      
  11.     call with:
  12.     Npar - Number of Paragraphs(16 bytes) to allocate.
  13.     
  14.     returns:
  15.     Seg  - Segment address of 1st paragraph, or an error code.
  16.     Error Code: 7 - memory control blocks destroyed.
  17.                 8 - insufficient memory.
  18.     Maxpar - Maximum number of available paragraphs, if allocation 
  19.         failed, otherwise the actual number of paragraphs allocated.
  20.          
  21.         example: Npar = 10
  22.         call AllMem(Npar,Seg,Maxpar)
  23.         if(Seg .eq.7 .or. Seg.eq.8)go to 1000
  24.  
  25.  
  26.  
  27.     FREMEM - Free memory allocated via AllMem.
  28.  
  29.     integer*2 Seg,Ierr
  30.         call FreMem(Seg,Ierr)
  31.  
  32.         call with:
  33.         Seg - Starting paragraph of memory block allocated with AllMem.
  34.  
  35.         returns:
  36.         Ierr - Error code = 0 -safe return, memory free'd
  37.                             7 -memory control blocks destroyed
  38.                             9 -incorrect segement address
  39.         example: 
  40.           NPAR = 16
  41.           call ALLMEM(NPAR,SEG,MAXPAR)
  42.           if(SEG.eq.7.or.SEG.eq.8)go to 900
  43.       call pokeb(Int2(0),Seg,Value)
  44.           .
  45.           .
  46.           call FREMEM(SEG,IERR)
  47.           if(IERR.ne.0)go to 1000  
  48.     FAT-DOS 1.0            MODMEM            PAGE A-2
  49.  
  50.  
  51.     MODMEM - Modify size of previously allocated memory block. 
  52.     
  53.     integer*2 NPAR,SEG,MAXSEG,IERR
  54.         call MODMEM(NPAR,SEG,MAXPAR,IERR)
  55.         
  56.         call with:
  57.         NPAR = desired modified memory size in paragraphs
  58.         SEG  = seg of current memory block
  59.  
  60.         returns:
  61.         MAXPAR = maximum no. of paragraphs available(if error)
  62.         IER    = 7 memory control blocks destroyed
  63.             = 8 insufficent memeory
  64.             = 9 incorrect seg
  65.      
  66.         example: NPAR = 512
  67.               call ALLMEM(NPAR,SEG,MAXPAR)
  68.               .
  69.               .           
  70.               NPAR =  16
  71.               call MODMEM(NPAR,SEG,MAXPAR,IERR)
  72.  
  73.  
  74.     PEEKB - Get a byte value from memory.
  75.  
  76.     integer*2 OFF,SEG,VALUE
  77.         call PEEKB(OFF,SEG,VALUE)
  78.  
  79.         call with:
  80.         OFF - offset value from start of segment, <=64k
  81.         SEG - segment value of byte location, <=64k
  82.      
  83.         returns:
  84.         VALUE - the byte value is stored in the lower byte of the
  85.                 integer*2 value and the high byte is zeroed.
  86.      
  87.         example:
  88.           call PEEKB(Int2(0),Int2(#B800),VALUE)
  89.           This call returns the ascii value of the character stored
  90.           in the 1st byte of the CGA adapter memory, at row 0, col 0
  91.           of the screen.
  92.  
  93.         Notes: An integer*2 is signed and may range from -32k to +32k.
  94.             If the segment or offset values exceed this amount you should
  95.             declare the segment and offset as integer*4.
  96.           i.e.
  97.             integer*4 SEG,OFF 
  98.             integer*2 VALUE
  99.             SEG = #B800  <--- .gt. 32k
  100.             OFF = 0
  101.             call PEEKB(OFF,SEG,VALUE)
  102.  
  103.     FAT-DOS 1.0            PEEKW            PAGE A-3
  104.  
  105.  
  106.     PEEKW - Get a word value from memory.
  107.  
  108.       integer*2 OFF,SEG,VALUE
  109.         call PEEKW(OFF,SEG,VALUE)
  110.  
  111.         call with:
  112.         OFF - offset value from start of segment, <=64k
  113.         SEG - segment value of word location, <=64k
  114.      
  115.         returns:
  116.         VALUE - the word value is returned in this argument.
  117.      
  118.         example:
  119.           call PEEKW(Int2(0),Int2(#0800),VALUE)
  120.           This call returns word stored at SEG= Hex 0800, OFF=0.
  121.  
  122.         Notes: An integer*2 is signed and may range from -32k to +32k.
  123.             If the segment or offset values exceed this amount you should
  124.             declare the segment and offset as integer*4.
  125.           i.e.
  126.             integer*4 SEG,OFF 
  127.             integer*2 VALUE
  128.             SEG = #B800  <--- .gt. 32k
  129.             OFF = 0
  130.             call PEEKW(OFF,SEG,VALUE)
  131.  
  132.  
  133.     PEEKL - Get a Long word value from memory.
  134.  
  135.       integer*2 OFF,SEG
  136.     integer*4 VALUE
  137.         call PEEKL(OFF,SEG,VALUE)
  138.  
  139.         call with:
  140.         OFF - offset value from start of segment, <=64k
  141.         SEG - segment value of long word location, <=64k
  142.      
  143.         returns:
  144.         VALUE - the long word value is returned in this argument.
  145.      
  146.         example:
  147.           call PEEKL(0,#0800,VALUE)
  148.           This call returns long word stored at SEG= Hex 0800, OFF=0.
  149.  
  150.         Notes: An integer*2 is signed and may range from -32k to +32k.
  151.             If the segment or offset values exceed this amount you should
  152.             declare the segment and offset as integer*4.
  153.           i.e.
  154.             integer*4 SEG,OFF 
  155.             integer*4 VALUE
  156.             SEG = #B800  <--- .gt. 32k
  157.             OFF = 0
  158.             call PEEKL(OFF,SEG,VALUE)
  159.     FAT-DOS 1.0            POKEB            PAGE A-4
  160.  
  161.  
  162.  
  163.     POKEB - Store a byte value in memory.
  164.  
  165.     integer*2 OFF,SEG,VALUE
  166.         call POKEB(OFF,SEG,VALUE)
  167.  
  168.         call with:
  169.         OFF - offset value from start of segment, <=64k
  170.         SEG - segment value of byte location, <=64k
  171.         VALUE - the byte value to store.
  172.      
  173.         returns:
  174.         nothing
  175.      
  176.         example: VALUE = ICHAR('A')
  177.            call POKEB(Int2(0),Int2(#B800),VALUE)
  178.           This call stores the ascii value of the character 'A'
  179.           in the 1st word of the CGA adapter memory, at row 0, col 0
  180.           of the screen.
  181.  
  182.         Notes: An integer*2 is signed and may range from -32k to +32k.
  183.             If the segment or offset values exceed this amount you should
  184.             declare the segment and offset as integer*4.
  185.           i.e.
  186.             integer*4 SEG,OFF 
  187.             integer*2 VALUE
  188.             SEG = #B800  <--- .gt. 32k
  189.             OFF = 0
  190.             call POKEB(OFF,SEG,VALUE)
  191.  
  192.  
  193.     POKEW - Store a word value in memory.
  194.  
  195.     integer*2 OFF,SEG,VALUE
  196.         call POKEW(OFF,SEG,VALUE)
  197.  
  198.         call with:
  199.         OFF - offset value from start of segment, <=64k
  200.         SEG - segment value of word location, <=64k
  201.         VALUE - the word value to store.
  202.      
  203.         returns:
  204.         nothing
  205.      
  206.         example: VALUE = 128
  207.            call POKEW(Int2(0),Int2(#0800),VALUE)
  208.           This call stores the value 128 at SEG=Hex 0800, OFF = 0.
  209.  
  210.         Notes: An integer*2 is signed and may be range from -32k to +32k.
  211.             If the segment or offset values exceed this amount you should
  212.             declare the segment and offset as integer*4.
  213.           i.e.
  214.             integer*4 SEG,OFF 
  215.             integer*2 VALUE
  216.             SEG = #B800  <--- .gt. 32k
  217.             OFF = 0
  218.             call POKEW(OFF,SEG,VALUE)
  219.  
  220.  
  221.     FAT-DOS 1.0            POKEL            PAGE A-5
  222.  
  223.  
  224.  
  225.     POKEL - Store a long word value in memory.
  226.  
  227.     integer*2 OFF,SEG
  228.     integer*4 VALUE
  229.         call POKEL(OFF,SEG,VALUE)
  230.  
  231.         call with:
  232.         OFF - offset value from start of segment, <=64k
  233.         SEG - segment value of long word location, <=64k
  234.         VALUE - the long word value to store.
  235.      
  236.         returns:
  237.         nothing
  238.      
  239.         example: VALUE = 128
  240.            call POKEL(Int2(0),Int2(#0800),VALUE)
  241.           This call stores the value 128 at SEG=Hex 0800, OFF = 0.
  242.  
  243.         Notes: An integer*2 is signed and may be range from -32k to +32k.
  244.             If the segment or offset values exceed this amount you should
  245.             declare the segment and offset as integer*4.
  246.           i.e.
  247.             integer*4 SEG,OFF 
  248.             integer*4 VALUE
  249.             SEG = #B800  <--- .gt. 32k
  250.             OFF = 0
  251.             call POKEL(OFF,SEG,VALUE)
  252.  
  253.  
  254.     FAT-DOS 1.0            OPFILX            PAGE B-1
  255.  
  256.  
  257.     OPFILX - Open an existing file, using the File Handle method.
  258.         The Ier variable should be checked after a call to 
  259.         OpFilx() to be sure a valid Handle has been returnd.
  260.  
  261.     character*n File
  262.     integer*2   Mode,Handle,Ier
  263.     call OpFilx(File,Mode,Handle,Ier)
  264.  
  265.     call with:
  266.     File = 'Name'//char(0), Asciiz string
  267.      MODE = 0   read
  268.           = 1   write
  269.           = 2   read/write
  270.  
  271.     returns:
  272.      HANDLE= file handle
  273.      IER  =  0   normal return
  274.          1   needs file sharing
  275.          2   file not found
  276.          3   path not found
  277.          4   no handle av